home *** CD-ROM | disk | FTP | other *** search
- property mySprite, Active, actionNum, myType, tileIconName, LSDisplaySprite, ancestor, initted, state
-
- on beginSprite me
- mySprite = me.spriteNum
- myType = #tileSprite
- state = #off
- Active = 0
- ancestor = new(script("LS_TileBehave actions"), mySprite)
- end
-
- on exitFrame me
- global gIsoEngineTracker, gIso, gUserDataMan
- if not initted then
- init(me)
- initted = 1
- end if
- if tileShouldGoInactive(me) then
- goInactive(me)
- else
- goActive(me)
- end if
- if not Active then
- exit
- end if
- set the loc of sprite mySprite to the mouseLoc
- end
-
- on mouseUp me
- global gIso, gUserDataMan, gPromptMan
- clickLoc = the mouseLoc
- if not Active then
- exit
- end if
- if voidp(LSDisplaySprite) then
- LSDisplaySprite = sendAllSprites(#sendSpriteNum, #LandscapingDisplay)
- end if
- curItem = sendSprite(LSDisplaySprite, #getCurItem)
- curCost = sendSprite(LSDisplaySprite, #getCurCost)
- curItem = string(curItem)
- curItem = replaceChar(curItem, "_", " ")
- curItemName = word 1 of curItem
- curItemNum = integer(word 2 of curItem)
- result = plantFoliage(gIso, the clickLoc, curItemNum)
- if result = curItemNum then
- itemSymbol = "landscaping_" & curItemName
- itemSymbol = symbol(itemSymbol)
- purchaseLandscaping(gUserDataMan, itemSymbol, curCost)
- else
- doPrompt(gPromptMan, #LSConflict)
- end if
- end
-
- on killTile me
- global gIsoEngineTracker
- setTileFloating(gIsoEngineTracker, 0)
- goInactive(me)
- actionNum = VOID
- myTile = VOID
- tileFloating = 0
- end
-
- on showProps me
- PropNum = count(me)
- repeat with x = 1 to PropNum
- prop = 0
- thisProp = getPropAt(me, x)
- if thisProp = #myHandlers then
- next repeat
- end if
- prop = string(getPropAt(me, x)) && "=" && getaProp(me, thisProp)
- put prop
- end repeat
- end
-